package com.situ.thread;

public class Demo {

    public static void main1(String[] args) {
        MyThread myThread = new MyThread();
        //启动一个线程调用start()
        myThread.start();
        for (int i = 0; i < 100; i++) {
            System.out.println(Thread.currentThread().getName() + " ：" +i);
        }
    }

    public static void main(String[] args) {
        MyRunnable myRunnable = new MyRunnable();
        Thread thread = new Thread(myRunnable);
        thread.start();
        for (int i = 0; i < 100; i++) {
            System.out.println(Thread.currentThread().getName() + " ：" +i);
        }
    }
}
